import { Config } from '../../utils/config.js';
Page({
  data: {
    myorderGrids: [{
      "id": 1,
      "url":"myorder",
      "icon": "icon-weibiaoti2fuzhi04",
      "labelName": "收益明细"
    },
    // {
    //   "id": 2,
    //   "url": "myorder",
    //   "icon": "icon-dingdan",
    //   "labelName": "销售订单"
    // },
    {
      "id": 3,
      "url": "children",
      "icon": "icon-rengezhongxin",
      "labelName": "我的会员"
    },
    ],
  },
  onLoad: function (options) {
    var user = wx.getStorageSync('userInfo');
    this.setData({ 
      user,
      domain:Config.domain
    })
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  //点击分享按钮
  toShare: function (e) {
    var model = e.currentTarget.dataset.model;
    this.setData({
      showpost: true
    })
    if(model == 'simple'){
      this.getSharePoster2();
    }else{
      this.getSharePoster();
    }
    
  },
  //调用子组件的方法
  getSharePoster: function () {
    this.selectComponent('#productPoster').getDiy(this.data.hasPost)
  },
  myEventListener: function (e) {
    this.setData({
      showpost: false,
      hasPost: e.detail.status
    })
  },
  //调用子组件的方法
  getSharePoster2: function () {
    this.selectComponent('#simplePoster').getDiy(this.data.hasPost2)
  },
  myEventListener2: function (e) {
    this.setData({
      showpost: false,
      hasPost2: e.detail.status
    })
  },
})